<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>优化节点添加</title>
    </head>
    <body>
        <script>
            for (let i = 0; i < 15; i++) {
                let op = document.createElement("p");
                op.innerHTML = i;
                document.body.appendChild(op);
            }

            const fragEle = document.createDocumentFragment();
            for (let i = 0; i < 15; i++) {
                let op = document.createElement("p");
                op.innerHTML = i;
                fragEle.appendChild(op);
            }
            document.body.appendChild(fragEle);
        </script>
    </body>
</html>
